@extends('layouts.art')
@section('content')

  <a class="btn btn-primary" href="{{route('articles.create')}}">添加文章</a>
  <a class="btn btn-primary" href="{{route('cate.index')}}">无限递归</a>  
  <a class="btn btn-primary" href="shop">购物车</a>  
  <a class="btn btn-primary" href="albums">相册</a>  
  <a class="btn btn-primary" href="avater">ajax上传</a>  
 
        <?php
            if(Auth::check()){
              $user = Auth::user();
          ?>
            <a href="auth/logout" class="btn btn-info">退出登录</a>
                       
          <?php
            }else{
          ?>
              <a href="auth/login" class="btn btn-info">登录</a>
              <a href="auth/register" class="btn btn-info">注册</a>
          <?php
            }
          ?>

  @foreach($articles as $article)
  <div class="panel panel-default">
  <div class="panel-body">
    {{$article->title}}
    <a href="{{route('articles.show',$article->id)}}" class="btn btn-info">阅读</a>
    <a href="{{route('articles.edit', $article->id)}}" class="btn btn-info">修改</a>

      <form action="{{ route('articles.destroy', $article->id) }}" method="post" style="display: inline-block;">
            {{ csrf_field() }}
            {{ method_field('DELETE') }}
            <button type="submit" class="btn btn-danger">删除</button>
        </form>
    </div>
    </div>
  
   @endforeach

{!! $articles->render() !!}
 @endsection
